package com.ccg.plat.presentation.common.base.receiver

import android.content.Context
import cn.jpush.android.api.NotificationMessage
import cn.jpush.android.service.JPushMessageReceiver
import com.ccg.plat.data.local.cache.UserInfoCache
import timber.log.Timber

/**
 * @author : C4_雍和
 * 描述 :
 * 主要功能 :
 * 维护人员 : C4_雍和
 * date : 2025/8/9 8:10
 */
class MyReceiver : JPushMessageReceiver() {
    override fun onNotifyMessageArrived(p0: Context?, message: NotificationMessage?) {
        super.onNotifyMessageArrived(p0, message)
        if (message?.notificationTitle == "充值成功") {
            Timber.e("充值成功")
            UserInfoCache.setUserVip(true)
        } else if (message?.notificationTitle == "关闭VIP") {
            Timber.e("关闭VIP")
            UserInfoCache.setUserVip(false)
        }
    }
}